var app = getApp();
var searchData={
    "historySearch":["城","西餐","虫子","骑士","早茶","浓郁"],
    "searchpage":[
        {
            "title":"场景",
            "itemObj":[
                        {
                            "id":1,
                            "imgSrc":"../../images/small-2.jpg",
                            "text":'朋友聚餐'
                        },
                        {
                             "id":2,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'约会'
                        },
                        {
                             "id":3,
                            "imgSrc":"../../images/small-5.jpg",
                            "text":'一人食'
                        },
                        {
                             "id":4,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'下午茶'
                        },
                        {
                             "id":5,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'闺蜜聚会'
                        },
                        {
                             "id":6,
                            "imgSrc":"../../images/small-2.jpg",
                            "text":'家庭聚餐'
                        },
                        {
                             "id":7,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'商务宴请'
                        },
                        {
                             "id":8,
                            "imgSrc":"../../images/small-3.jpg",
                            "text":'宵夜'
                        },
                        {
                             "id":9,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'早茶'
                        },
                        {
                             "id":10,
                            "imgSrc":"../../images/small-4.jpg",
                            "text":'拍照'
                        }
                    ]
                
        },
        {
            "title":"口味",
            "itemObj":[
                        {
                             "id":11,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'甜'
                        },
                        {
                             "id":12,
                            "imgSrc":"../../images/small-5.jpg",
                            "text":'麻辣'
                        },
                        {
                             "id":13,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'鲜'
                        },
                        {
                             "id":14,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'浓郁'
                        },
                        {
                            "id":15,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'酸辣'
                        },
                        {
                            "id":16,
                            "imgSrc":"../../images/small-4.jpg",
                            "text":'香辣'
                        },
                        {
                            "id":17,
                            "imgSrc":"../../images/small-2.jpg",
                            "text":'咸鲜'
                        },
                        {
                            "id":18,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'清淡'
                        },
                        {
                            "id":19,
                            "imgSrc":"../../images/small-3.jpg",
                            "text":'辣'
                        },
                        {
                            "id":20,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'咖喱'
                        }
                    ]
        },
        {
            "title":"商圈",
            "itemObj":[
                        {
                            "id":21,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'天河城'
                        },
                        {
                            "id":22,
                            "imgSrc":"../../images/small-4.jpg",
                            "text":'江南西'
                        },
                        {
                            "id":23,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'环市东'
                        },
                        {
                            "id":24,
                            "imgSrc":"../../images/small-5.jpg",
                            "text":'北京路'
                        },
                        {
                            "id":25,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'天河北'
                        },
                        {
                            "id":26,
                            "imgSrc":"../../images/small-4.jpg",
                            "text":'高德置地'
                        },
                        {
                            "id":27,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'天河公园'
                        },
                        {
                            "id":28,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'中山三路'
                        },
                        {
                            "id":29,
                            "imgSrc":"../../images/small-2.jpg",
                            "text":'客村'
                        },
                        {
                            "id":30,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'兴盛路'
                        }
                    ]
        },
        {
            "title":"类别",
            "itemObj":[
                        {
                            "id":31,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'粤菜'
                        },
                        {
                            "id":32,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'川菜'
                        },
                        {
                            "id":33,
                            "imgSrc":"../../images/small-4.jpg",
                            "text":'西餐'
                        },
                        {
                            "id":34,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'日本料理'
                        },
                        {
                            "id":35,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'饮品'
                        },
                        {
                            "id":36,
                            "imgSrc":"../../images/small-3.jpg",
                            "text":'面包甜点'
                        },
                        {
                            "id":37,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'湘菜'
                        },
                        {
                            "id":38,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'东南亚菜'
                        },
                        {
                            "id":39,
                            "imgSrc":"../../images/small-5.jpg",
                            "text":'法国菜'
                        },
                        {
                            "id":40,
                            "imgSrc":"../../images/small-1.jpg",
                            "text":'东北菜'
                        }
                    ]
        }
    ],
    "inputVal":""
};
Page({
    data:searchData,
    searchInput:function(e){
        this.setData({
            "inputVal":e.detail.value
        });
    },
    formSubmit: function(e) {
        console.log(e.detail)
        wx.navigateTo({
                url: '../search-result/search-result?searchVal='+this.data.inputVal
            })
    },
    clearHistory:function(){
        this.setData({
            "historySearch":[]
        });
    }
})